
using AutoMapper;
using Ccteg.Common;



namespace Cctegaq.Api.Configurations
{
    /// <summary>
    /// 
    /// </summary>
    public class MappingProfile : Profile
    {
        /// <summary>
        /// 
        /// </summary>
        public MappingProfile()
        {
           

            #region 安全风险业务
            CreateMap<srb_main_project, Srb_main_project_ViewModel>();
            #endregion

            #region 法律法规
            CreateMap<law_law, Law_Law_ViewModel>();
            //新增
            CreateMap<Law_Law_ViewModel, law_law>();
            #endregion

            #region 安全工作管理
            CreateMap<tar_tar, Tar_tar_ViewModel>();
            //新增
            CreateMap<Tar_tar_ViewModel, tar_tar>();
            #endregion
            #region 安全组织机构和责任管理
            CreateMap<org_org, Org_Org_ViewModel>();
            //新增
            CreateMap<Org_Org_ViewModel, org_org>();

            //树
            CreateMap<org_org, Tree_ViewModel>()
               .ForMember(d => d.ParentId, s => s.MapFrom(x => x.ParentOrgNo))
                .ForMember(d => d.Id, s => s.MapFrom(x => x.OrgNo))
                .ForMember(d => d.NumOrder, s => s.MapFrom(x => x.Sort))
                .ForMember(d => d.Code, s => s.MapFrom(x => x.CompanyNo))
               .ForMember(d => d.Name, s => s.MapFrom(x => x.Name + "(" + x.Header + ")"));

            #endregion
            #region  企业信息

            CreateMap<ent_baseinfo, Tree_ViewModel>()
                 .ForMember(d => d.Id, s => s.MapFrom(x => x.CompanyNo))
                 .ForMember(d => d.Name, s => s.MapFrom(x => x.CompanyName))
                   .ForMember(d => d.ParentId, s => s.MapFrom(x => x.ParentNo));
            #endregion
            #region 安全文化
            CreateMap<Scl_Scl, Scl_Scl_ViewModel>();
            //新增
            CreateMap<Scl_Scl_ViewModel, Scl_Scl>();
            #endregion

            #region 安全风险业务清单
            CreateMap<srb_main_risk, Srb_main_risk_ViewModel>();


            #endregion

            #region 安全风险业务措施
            CreateMap<srb_main_risk_measure, Srb_main_risk_measure_ViewModel>();
            #endregion


            #region 安全会议
            CreateMap<Scf_Scf, Scf_Scf_ViewModel>();
            //新增
            CreateMap<Scf_Scf_ViewModel, Scf_Scf>();
            #endregion


            #region 风险管控
            CreateMap<rsk_rsk, Rsk_rsk_ViewModel>();
            #endregion
            #region 风险管控----管控措施
            CreateMap<rsk_measure, Rsk_measure_ViewModel>();
            #endregion
        }
    }
}
